<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>

</body>
<script>
    // var arr = [1, 2, 1, 3, 4, 5, 6, 3, 3, 1, 2];

    var arr = [1, 2, 1, 3, 4, 5, 6, 3, 3, 1, 2];
    var arr2 = [];
    for (var i = 0; i < arr.length; i++) {
        if (arr2.indexOf(arr[i]) == -1) {
            arr2.push(arr[i]);
        }
    }
    console.log(arr2);









    var arr = [1, 2, 1, 3, 4, 5, 6, 3, 3, 1, 2];
    var obj = {};
    for (var i = 0; i < arr.length; i++) {
        var val = arr[i];
        obj[val] = val;
    }
    console.log(obj);

    var arr2 = [];
    for (var key in obj) {
        arr2.push(parseInt(key));
    }
    console.log(arr);
</script>

</html>